import sqlite3

# 打开数据库文件
conn = sqlite3.connect('checkpoints.db')
cursor = conn.cursor()

# 查询所有表名
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
tables = cursor.fetchall()
print("所有表名：", tables)

# 依次读取每个表的内容
for table in tables:
    table_name = table[0]
    print(f"\n表名: {table_name}")
    cursor.execute(f"SELECT * FROM {table_name}")
    rows = cursor.fetchall()
    for row in rows:
        print(row)

conn.close()